import WatchFn from './WatchFn.js'
export function ref(value){
    return {
        _value:value,
        get value(){
            if(WatchFn.value){
                this.deps.push(WatchFn.value)
            }
            return this._value
        },
        set value(newVal){
            this._value=newVal
            this.deps.forEach(fn=>{
                setTimeout(fn,0)
            })
        },
        deps:[]
    }
}